package cn.sciento.transfer.infra.repository.impl;

import cn.sciento.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import java.util.List;
import cn.sciento.mybatis.base.impl.BaseRepositoryImpl;
import cn.sciento.transfer.domain.entity.EventError;
import cn.sciento.transfer.domain.repository.EventErrorRepository;
import cn.sciento.transfer.infra.mapper.EventErrorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EventErrorRepositoryImpl extends BaseRepositoryImpl<EventError> implements EventErrorRepository {
  @Autowired
  private EventErrorMapper eventErrorMapper;
  
  public Page<EventError> pageEventErrorByCondition(EventError eventError, PageRequest pageRequest) {
    return PageHelper.doPageAndSort(pageRequest, () -> this.eventErrorMapper.listEventErrorByCondition(eventError));
  }
}
